/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __UART_H__
#define __UART_H__

/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"

/* Exported types ------------------------------------------------------------*/
typedef enum{
    GET_STATUS  = 'S',
    SET_TIMER   = 'T',
    SET_RELAY   = 'R',
} eCOMMAND;

typedef enum{
    GET_STATUS          = 's',
    SET_SAMPLE_TIMER    = 't',
} eSUB_COMMAND;

struct sTxBuff{
    U8 Length;
    U8 pData[TX_LENGTH];
};

/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

void UART_Init(void);
bool UART_Send(u8* pData, u8 iLen);
void UART_Reply(u8 iCmd, u8* pData, u8 iLen);
void UART_RunOne(void);

#endif /* __UART_H__ */

